<?php

namespace app\teacher\model;

use app\common\model\BaseModel;
use think\Model;

class CourseReply extends BaseModel
{
    protected $autoWriteTimestamp = 'int';
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';

    /**
     * 添加回复
     */
    public function add($teacherId, $courseCommentId, $content)
    {
        $data = [
            'teacher_id' => $teacherId,
            'course_comment_id' => $courseCommentId,
            'content' => $content
        ];
        return $this->allowField(true)->save($data);
    }
}
